import { Message } from 'element-ui';
  const util ={
    success: (msg)=>{
        Message.success({
            message: msg,
            type: 'success'
          });
    },
    warn: (msg)=>{
        Message.warning({
            message: msg,
            type: 'warning'
          });
    },
    error:(msg)=>{
       Message.error(msg);
    },
    processErrorResponse:(response)=>{
        if (response.status && response.status === 500) {
            this.error(response);
        }
        if (response.status && response.status === 404) {
            this.error('请求路径不存在.');
        }
        if (response.status && (response.status === 503 ||response.status === 502)  ) {
            this.error('服务正在系统维护中，请稍后再来.');
        }
        if (response.status && response.status === -1) {
            this.error('系统连接超时，请稍后再试。.');
        }
    }
}
export default util